package com.wrap.mango.lowprice;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "lowprice-result")
public class LowPriceResult {

    private List<com.mangocity.airticket.b2b.webservice.Flight> lowPrices;

    private String message;

    private String result = "fail";
    
    public LowPriceResult convertLowPriceResult(com.mangocity.airticket.b2b.webservice.LowPriceResulst lowPriceResult) {
        LowPriceResult priceResult = new LowPriceResult();
        if (null != lowPriceResult) {
            List<com.mangocity.airticket.b2b.webservice.Flight> flights = new ArrayList<com.mangocity.airticket.b2b.webservice.Flight>();
            for (com.mangocity.airticket.b2b.webservice.Flight flight : lowPriceResult.getLowPriceList()) {
                if (null != flight) {
                    flights.add(flight);
                }
            }
            priceResult.setLowPrices(flights);
            priceResult.setMessage(lowPriceResult.getMessage());
            priceResult.setResult(lowPriceResult.getResulst());
        } 
        return priceResult;
    }

    public List<com.mangocity.airticket.b2b.webservice.Flight> getLowPrices() {
        return lowPrices;
    }

    public void setLowPrices(List<com.mangocity.airticket.b2b.webservice.Flight> lowPrices) {
        this.lowPrices = lowPrices;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

}
